<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>

<head>
	<title>OpenSSL.NET</title>

	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script type="text/javascript">
		try{
			var pageTracker = _gat._getTracker("UA-3313431-2");
			pageTracker._trackPageview();
		} catch(err) {}
	</script>

</head>
<body>

<h1>OpenSSL.NET</h1>
<p>
A managed <a href="http://www.openssl.org">OpenSSL</a> wrapper written in C#
for the 2.0 .NET Framework that exposes both the
<a href="http://www.openssl.org/docs/crypto/crypto.html">Crypto API</a> and
the <a href="http://www.openssl.org/docs/ssl/ssl.html">SSL API</a>.
This a must for .NET developers that need crypto but don't want to use
Microsoft's SSPI.
This wrapper is based on version 0.9.8k of libeay32.dll and ssleay32.dll.
</p>

<p>
A big thanks goes to Ben Henderson for contributing the wrapper for the
SSL API!
</p>

<h3>Download</h3>
The latest version (0.4.4) can be downloaded
<a href="http://sourceforge.net/projects/openssl-net/files/">here</a>.

<h3>Installation</h3>
Make sure you have libeay32.dll and ssleay32.dll in the current working
directory of your application or in your PATH.
In your .NET project, add a reference to the ManagedOpenSsl.dll assembly.

<h3>Documentation</h3>

Take a look at the low-level C API
<a href="http://www.openssl.org/docs">documentation</a>
over at the openssl.org.

<ul>
<li><a href="README">README</a></li>
<li><a href="INSTALL">INSTALL</a></li>
<li><a href="CHANGES">CHANGES</a></li>
<li><a href="TODO">TODO</a></li>
<li><a href="COPYING">COPYING</a></li>
<li><a href="LICENSE">LICENSE</a></li>
</ul>

<h4>Wrapper Example</h4>

<p>
The following is a partial example to show the general pattern of wrapping
onto the C API.
</p>

Take DSA and the following C prototypes:
<code>
<pre>
DSA *  DSA_new(void);
void   DSA_free(DSA *dsa);
int    DSA_size(const DSA *dsa);
int    DSA_generate_key(DSA *dsa);
int    DSA_sign(int dummy, const unsigned char *dgst, int len,
                unsigned char *sigret, unsigned int *siglen, DSA *dsa);
int    DSA_verify(int dummy, const unsigned char *dgst, int len,
                const unsigned char *sigbuf, int siglen, DSA *dsa);
</pre>
</code>

Which gets wrapped as something akin to:
<code>
<pre>
public class DSA : IDisposable
{
    // calls DSA_new()
    public DSA();

    // calls DSA_free() as needed
    ~DSA();

    // calls DSA_free() as needed
    public void Dispose();

    // returns DSA_size()
    public int Size { get; }

    // calls DSA_generate_key()
    public void GenerateKeys();

    // calls DSA_sign()
    public byte[] Sign(byte[] msg);

    // returns DSA_verify()
    public bool Verify(byte[] msg, byte[] sig);
}
</pre>
</code>

</body>
</html>
